﻿using System;
using System.Data;
using System.Configuration;
using Token.Piker.Core.Model;

namespace Token.Piker.Core.Security
{
    /// <summary>
    /// 身份验证结果
    /// </summary>
    public enum EAuthenticateResult
    {
        /// <summary>
        /// 通过验证
        /// </summary>
        Passed,
        /// <summary>
        /// 用户已经登录，但是没有权限访问此页面
        /// </summary>
        AccessDeny,
        /// <summary>
        /// 用户没有登录
        /// </summary>
        NotLogged
    }


    /// <summary>
    /// IAuthzManager 的摘要说明
    /// </summary>
    public interface IAuthzManager
    {
        /// <summary>
        /// 验证用户权限
        /// </summary>
        /// <param name="desiredRole">需要的权限</param>
        /// <returns>验证结果</returns>
        EAuthenticateResult Validate(AbstractUser.ERole desiredRole);
    }

}
